import { createGlobalStyle } from 'styled-components';

const GlobalStyles = createGlobalStyle`
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html, body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
  }

  a {
    text-decoration: none;
    color: #1890ff;
    transition: color 0.3s;
    
    &:hover {
      color: #40a9ff;
    }
  }

  ul, ol {
    list-style: none;
  }

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  button {
    border: none;
    outline: none;
    cursor: pointer;
    background: transparent;
    transition: all 0.3s;
  }

  input, textarea {
    outline: none;
    transition: all 0.3s;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  }

  /* Ant Design Customizations */
  .ant-btn {
    border-radius: 6px;
    font-weight: 500;
  }

  .ant-btn-primary {
    box-shadow: 0 2px 0 rgba(24, 144, 255, 0.1);
  }

  .ant-btn-primary:hover {
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.2);
    transform: translateY(-1px);
  }

  .ant-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.3s;
  }

  .ant-divider {
    margin: 16px 0;
  }

  .ant-table {
    border-radius: 12px;
    overflow: hidden;
  }

  .clearfix:after {
    content: '';
    display: table;
    clear: both;
  }

  /* 遮罩层 */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  /* 常用颜色 */
  .text-primary {
    color: #1890ff;
  }

  .text-success {
    color: #52c41a;
  }

  .text-warning {
    color: #faad14;
  }

  .text-danger {
    color: #f5222d;
  }

  .text-muted {
    color: #8c8c8c;
  }

  /* 渐变背景 */
  .bg-gradient-primary {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  }

  .bg-gradient-success {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
  }

  /* 动画效果 */
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .fade-in {
    animation: fadeIn 0.3s ease-in-out;
  }

  /* 常用间距 */
  .mt-5 {
    margin-top: 5px;
  }
  .mt-10 {
    margin-top: 10px;
  }
  .mt-15 {
    margin-top: 15px;
  }
  .mt-20 {
    margin-top: 20px;
  }
  .mt-30 {
    margin-top: 30px;
  }
  .mt-40 {
    margin-top: 40px;
  }

  .mb-5 {
    margin-bottom: 5px;
  }
  .mb-10 {
    margin-bottom: 10px;
  }
  .mb-15 {
    margin-bottom: 15px;
  }
  .mb-20 {
    margin-bottom: 20px;
  }
  .mb-30 {
    margin-bottom: 30px;
  }
  .mb-40 {
    margin-bottom: 40px;
  }

  .ml-5 {
    margin-left: 5px;
  }
  .ml-10 {
    margin-left: 10px;
  }
  .ml-15 {
    margin-left: 15px;
  }
  .ml-20 {
    margin-left: 20px;
  }

  .mr-5 {
    margin-right: 5px;
  }
  .mr-10 {
    margin-right: 10px;
  }
  .mr-15 {
    margin-right: 15px;
  }
  .mr-20 {
    margin-right: 20px;
  }

  /* Flexbox 布局辅助 */
  .d-flex {
    display: flex;
  }

  .flex-column {
    flex-direction: column;
  }

  .justify-center {
    justify-content: center;
  }

  .justify-between {
    justify-content: space-between;
  }

  .justify-around {
    justify-content: space-around;
  }

  .align-center {
    align-items: center;
  }

  .flex-wrap {
    flex-wrap: wrap;
  }

  .flex-1 {
    flex: 1;
  }

  /* 内容容器 */
  .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
  }

  /* 响应式容器 */
  @media screen and (max-width: 1200px) {
    .container {
      width: 100%;
    }
  }
  
  /* 卡片阴影效果 */
  .card-shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
  }
  
  .card-shadow:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
  }
`;

export default GlobalStyles; 